package com.javafactroy.kunlong.data.service;


import com.github.pagehelper.PageHelper;
import com.javafactroy.kunlong.data.entity.mysql.MysqlColumns;
import com.javafactroy.kunlong.data.dao.mysql.MysqlColumnsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class MysqlColumnsService {
    @Autowired
    MysqlColumnsMapper mapper;

    public int insert(MysqlColumns entity) {
        return mapper.insert(entity);
    }

    public int update(MysqlColumns entity) {
        return mapper.updateByPrimaryKey(entity);
    }

    public int updateNotNull(MysqlColumns entity) {
        return mapper.updateByPrimaryKeySelective(entity);
    }

    public int deleteByPkey(MysqlColumns entity) {
        return mapper.deleteByPrimaryKey(entity);
    }

    public int deleteBy(MysqlColumns entity) {
        return mapper.delete(entity);
    }

    public int selectCount(MysqlColumns entity) {
        return mapper.selectCount(entity);
    }

    public MysqlColumns selectByPkey(Object pkey) {
        return mapper.selectByPrimaryKey(pkey);
    }

    public List<MysqlColumns> select (MysqlColumns e) {
        PageHelper.startPage(1,2);
        return mapper.select(e);
    }

    public List<MysqlColumns> selectAll ( ) {
        return mapper.selectAll();
    }



}
